package day07;

import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int result = (int)(Math.random()*1000+1);
        System.out.println(result);

        while (true){
            System.out.println("猜吧！");
            int guess = scan.nextInt();
            if(guess>result){
                System.out.println("猜大了");
            }else if(guess<result){
                System.out.println("猜小了");
            }else{
                System.out.println("恭喜你，猜对了");
                break;
            }
        }

        /*
        if(month>=1 && month <=12){
            if(month>=5 && month <=10){
                switch (command){
                    case 1:
                        System.out.println("机票价格为"+price*0.9);
                        break;
                    case 2:
                        System.out.println("机票价格为"+price*0.85);
                        break;
                    case 3:
                        System.out.println("机票价格为"+price*0.8);
                        break;
                    default:
                        System.out.println("信息输入有误");
                }
            }else if(month<=4 && month >=10){
                switch (command){
                    case 1:
                        System.out.println("机票价格为"+price*0.7);
                        break;
                    case 2:
                        System.out.println("机票价格为"+price*0.65);
                        break;
                    case 3:
                        System.out.println("机票价格为"+price*0.6);
                        break;
                    default:
                        System.out.println("信息输入有误");
                }
            }
        }else{
            System.out.println("信息输入有误");
        }

         */
    }
}
